#include <iostream>
#include <cv.h>
#include <highgui.h>
#include <cstdlib>
#include <bitset>

using namespace std;
using namespace cv;

int main(int argc, char* argv[]) {
    Mat random;

    random = Mat(100, 100, CV_32FC1);

    int i, j, k, l, c;

    for (c=0; c<26; c++) {
        for (i=0; i<3; i++) {
            for (j=0; j<2; j++) {
                for (k=i*100; k<((i+1)*100); k++) {
                    for (l=j*100; l<((j+1)*100); l++) {
                        if (c & (1 << (i*2+j))) {
                            random.at<float>(k,l) = 1;
                        } else {
                            random.at<float>(k,l) = 0;
                        }
                    }
                }
            }
        }
    namedWindow("Display Image", CV_WINDOW_AUTOSIZE);
    imshow("Display Image", random);
    char fname[20];
    sprintf(fname, "%d.png", c);
    imwrite(fname, random);

    waitKey(0);
    }

}
